package com.nie.mybatisPlus.generator.system.controller;

import com.nie.mybatisPlus.generator.system.entity.User;
import com.nie.mybatisPlus.generator.system.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author nie_chao_qun
 * @since 2022-11-17
 */
@RestController
@RequestMapping("/system/user")
@Api(tags = "用户请求")
public class UserController {

    @Resource
    private IUserService userService;

    @GetMapping("ping")
    public String ping() {
        return "ping";
    }

    @PostMapping("saveUser")
    @ApiOperation(value = "用户保存")
    public String saveUser(@RequestBody User user) {
        userService.save(user);
        return "sucess";
    }
}
